package com.example.demo.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Finance;
import com.example.demo.entity.Notice;
import com.example.demo.mapper.NoticeMapper;
import com.example.demo.service.NoticeService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceimpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {

    @Override
    public List<Notice> getAllNotice() {
        return baseMapper.selectList(null);
    }

    @Override
    public Notice findBytitle(String title) {
        QueryWrapper<Notice> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("title", title);
        return baseMapper.selectOne(queryWrapper);
    }

    @Override
    public Notice getById(Long noticeId) {
        return baseMapper.selectById(noticeId);
    }

    @Override
    public boolean updateById(Notice entity) {
        return super.updateById(entity);
    }
}